<?php

namespace app\admin\controller;
//namespace app\admin\controller;

use think\Controller;
use think\Model;
use think\Request;
use think\Db;

class Customer extends Controller
{
    public function index()
    {
        //session_destroy();
		return $this -> fetch();
        //return view();
    }

    /*
     * 获取用户列表数据
     */
    public function getData()
    {
		$queryparam = json_decode(file_get_contents("php://input"), true);
		//file_put_contents('D:\product\91duandai\Application\Integrate\1001.php',var_export($queryparam,TRUE));
        $user = Model('User');

        // if (null != $queryparam['u_name']) {
        //     $searchcontent = trim($queryparam['u_name']);
        //     $map['u_name']  = array('EXP'," LIKE '%$searchcontent%' ");
        // }
        // if (null != $queryparam['u_phone']) {
        //     $searchcontent = trim($queryparam['u_phone']);
        //     $map['ddb_user.u_phone']  = array('EXP'," LIKE '%$searchcontent%' ");
        // }

        // if (null != $queryparam['limit']) {
        //     if ('0' == $queryparam['offset']) {
        //         $Model->limit(0,$queryparam['limit']);
        //     } else {
        //         $Model->limit($queryparam['offset'],$queryparam['limit']);
        //     }
        // }
        $result =$user->select();
		$total = $user->count();

   //      for($i=0;$i<count($result);$i++){
   //          $result[$i]["col_overdue"]=json_decode($result[$i]["col_overdue"],true);
   //          $result[$i]["col_multiloan"]=json_decode($result[$i]["col_multiloan"]);
   //          foreach($result[$i]["col_overdue"] as $k=>$v){
   //          $result[$i]["col_kex"]=json_decode($result[$i]["col_kex"],true);
   //          $result[$i]["riskLevel"]=$result[$i]["col_kex"]['riskLevel'];
			// //$result[$i]["riskDesc"]=$result[$i]["col_kex"]['riskDesc'];*/
   //      }
		//file_put_contents('D:\product\91duandai\Application\Integrate\510.php',var_export($result,TRUE),FILE_APPEND);
        echo json_encode(array('rows' => $result, 'total' => $total));
//        echo json_encode(array('rows' => $result, 'total' => $total));
	
    }

    // public function edit()
    // {

    // }
}
?>